/* BusInfoDao.java
 *
 * Project/Product: GWBS2009
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   apep	2010-1-26	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2010
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package com.apep.jwcs.dao;

import java.util.ArrayList;

import com.apep.jwcs.pojo.BusInfo;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.lib.db.GSBaseDAO;
import com.hitrust.gs.util.exception.GSException;

public class BusInfoDao extends GSBaseDAO{
    
    public BusInfo selectBusInfoByCode(String code)throws GSException {
        BusInfo busInfo=new BusInfo();
        String sql="select * from T_BUS_INFO where BUS_CODE=?";
        ArrayList list=null;
        Object[] tObj={code};
        try {
            list=this.executeQuery(new BusInfo(), sql, tObj);
            if(list.size()>0){
                busInfo=(BusInfo)list.get(0);
            }
        } catch (Exception e) {
            GSLogWriter.error(this,e.toString());
            throw new GSException(GSException.E10040, GSException.E10040_MSG);
        }
        return busInfo;
    }
}
